{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/UserItem/index.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport classNames from \"classnames\";\nimport { getUserName } from \"../../utils/User\";\nimport { Avatar, Name } from \"../index\";\nimport { observer } from \"mobx-react-lite\";\nimport { Context } from \"../../index\";\nimport './UserItem.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nconst UserItem = props => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  if (props.profile.id) {\n    return /*#__PURE__*/_jsxDEV(\"div\", {\n      className: classNames('users__item', {\n        'users__item--online': true,\n        'users__item--active': store.getViewedUserProfile().id === props.profile.id\n      }),\n      onClick: () => {\n        if (store.getViewedUserProfile().id === props.profile.id) {\n          store.viewedUserProfile = {};\n        } else {\n          store.setViewedUserProfile({\n            ...store.getViewedUserProfile(),\n            ...props.profile\n          });\n        }\n      },\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"users__item--avatar\",\n        children: /*#__PURE__*/_jsxDEV(Avatar, {\n          contentList: props.profile.content,\n          alt: getUserName(props.profile),\n          stringForFirstCharacter: getUserName(props.profile),\n          stringForGenerateColor: props.profile.id\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 35,\n          columnNumber: 21\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 34,\n        columnNumber: 17\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"users__item-info\",\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"users__item-info-top\",\n          children: /*#__PURE__*/_jsxDEV(\"p\", {\n            className: \"users__item-name\",\n            children: /*#__PURE__*/_jsxDEV(Name, {\n              user: props.profile,\n              multiChat: false\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 45,\n              columnNumber: 29\n            }, this)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 44,\n            columnNumber: 25\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 43,\n          columnNumber: 21\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"users__item-info-bottom\",\n          children: /*#__PURE__*/_jsxDEV(\"p\", {\n            children: props.profile.nickname\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 49,\n            columnNumber: 25\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 48,\n          columnNumber: 21\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 42,\n        columnNumber: 17\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 16,\n      columnNumber: 13\n    }, this);\n  } else {\n    return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n  }\n};\n_s(UserItem, \"fWWYyndAah+pK9pcP7nWnrsVVfw=\");\n_c = UserItem;\nexport default _c2 = observer(UserItem);\nvar _c, _c2;\n$RefreshReg$(_c, \"UserItem\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","classNames","getUserName","Avatar","Name","observer","Context","UserItem","props","store","useContext","profile","id","getViewedUserProfile","viewedUserProfile","setViewedUserProfile","content","nickname"],"sources":["/data/messenger.client/src/components/UserItem/index.tsx"],"sourcesContent":["import React from 'react';\nimport {UserItemProps} from \"../../models/props/UserItemProps\";\nimport classNames from \"classnames\";\nimport {getUserName} from \"../../utils/User\";\nimport {Avatar, Name} from \"../index\";\nimport {observer} from \"mobx-react-lite\";\nimport {Context} from \"../../index\";\nimport './UserItem.scss';\nimport {UserListItem} from \"../../models/response/UserListItem\";\n\nconst UserItem: React.FC<UserItemProps> = (props) => {\n    const {store} = React.useContext(Context);\n\n    if (props.profile.id) {\n        return (\n            <div\n                className={classNames('users__item', {\n                    'users__item--online' : true,\n                    'users__item--active':\n                        store.getViewedUserProfile().id === props.profile.id\n                })}\n                onClick={() => {\n\n                    if (store.getViewedUserProfile().id === props.profile.id) {\n                        store.viewedUserProfile = {} as UserListItem;\n                    } else {\n                        store.setViewedUserProfile({\n                            ...store.getViewedUserProfile(),\n                            ...props.profile\n                        });\n                    }\n                }}\n            >\n                <div className=\"users__item--avatar\">\n                    <Avatar\n                        contentList={props.profile.content}\n                        alt={getUserName(props.profile)}\n                        stringForFirstCharacter={getUserName(props.profile)}\n                        stringForGenerateColor={props.profile.id}\n                    />\n                </div>\n                <div className=\"users__item-info\">\n                    <div className=\"users__item-info-top\">\n                        <p className='users__item-name'>\n                            <Name user={props.profile} multiChat={false} />\n                        </p>\n                    </div>\n                    <div className='users__item-info-bottom'>\n                        <p>{props.profile.nickname}</p>\n                    </div>\n                </div>\n            </div>\n        );\n    } else {\n        return (<></>);\n    }\n}\n\nexport default observer(UserItem);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAOC,UAAU,MAAM,YAAY;AACnC,SAAQC,WAAW,QAAO,kBAAkB;AAC5C,SAAQC,MAAM,EAAEC,IAAI,QAAO,UAAU;AACrC,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,aAAa;AACnC,OAAO,iBAAiB;AAAC;AAAA;AAGzB,MAAMC,QAAiC,GAAIC,KAAK,IAAK;EAAA;EACjD,MAAM;IAACC;EAAK,CAAC,GAAGT,KAAK,CAACU,UAAU,CAACJ,OAAO,CAAC;EAEzC,IAAIE,KAAK,CAACG,OAAO,CAACC,EAAE,EAAE;IAClB,oBACI;MACI,SAAS,EAAEX,UAAU,CAAC,aAAa,EAAE;QACjC,qBAAqB,EAAG,IAAI;QAC5B,qBAAqB,EACjBQ,KAAK,CAACI,oBAAoB,EAAE,CAACD,EAAE,KAAKJ,KAAK,CAACG,OAAO,CAACC;MAC1D,CAAC,CAAE;MACH,OAAO,EAAE,MAAM;QAEX,IAAIH,KAAK,CAACI,oBAAoB,EAAE,CAACD,EAAE,KAAKJ,KAAK,CAACG,OAAO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